<html onclick="Click1()">
	<head>
		<meta charset="utf-8">
		<title>点击小星星</title>
		<script>
			// function text1(argument) {
			// 	// body...
			// 	var str = "窗口左边距离：" +event.clientX + "窗口上边距离：" + event.clientY;
			// 	str += "\n网页左边：" + event.x + "，网页上边" + event.y;
			// 	str += "\n屏幕左边距离：" + event.screenX + "，屏幕上边距离：" + event.screenY;
			// 	str += "\n事件类型：" + event.type;
			// 	alert(str);
			// }
			function Click1() {
				// body...
				var imgObj = document.createElement("img");
				//添加到body节点上
				document.body.appendChild(imgObj);
				//添加图片
				imgObj.setAttribute("src", "image/day6/xingxing.gif");
				//添加width属性
				var width = getRandom(15, 85);
				imgObj.setAttribute("width", width);
				//设置位置参数
				var x = event.clientX - width / 2;
				var y = event.clientY - width / 2;
				imgObj.style.position = "absolute";
				imgObj.style.left = x + "px";
				imgObj.style.top = y + "px";
				
    			
			}

			function getRandom(x1, x2) {
				var rand = Math.random() * (x2 - x1) + x1;
				rand = Math.floor(rand);
				return rand;
			}

		</script>
	</head>
	<body>
		<!-- <img src="image/01.jpg" onclick="text1()"> -->
	</body>
</html>